package lesson1_2;

import java.util.Scanner;

//从控制台输入一个整数，判断该整数有几位
public class Demo5 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入数字...");
        int num = scanner.nextInt();
        int count = 0;
        if(num == 0){
            count++;
        }else{
            while(num != 0){
                num /=10;
                count++;
            }
        }

        System.out.println(count);
    }
}
